#include "../head.h"

template <typename T1, typename T2>
struct human
{
    void operator()(T2 x)
    {
        cout << "generalization" << endl;
        cout << x << endl;
    }
};

template <typename T2>
struct human<int, T2>
{
    void operator()(T2 x)
    {
        cout << "partial specialization" << endl;
        cout << x << endl;
    }
};

template<typename T>
void print(const T & firstarg)
{
    cout << firstarg << endl;
}

template <typename T, typename... Types>
void print(const T &firstarg, const Types &... args)
{
    cout << firstarg << endl;
    print(args...);
}

int main()
{
    // 注意不管是泛化还是偏特化，都需要多个模板参数<>，不过编译器会自动识别符合偏特化的版本
    human<double, double>()(10.1);
    human<int, double>()(10.2);
    cout << __cplusplus << endl;
    print(1, "sad", 10.2);
}